package blackeagle.ems.dal;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Keeps track of column information such as the name, whether or not the column is a primary key and
 * whether or not the column auto increments. Also keeps track of whether the method to which the annotation
 * is attached is a getter or a setter. Only applicable to methods. Retained in runtime.
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface DataField {
    /**
     * Signifies whether or not the column is a primary key. <code>false</code> by default.
     * @return <code>true</code> if the column is a primary key; otherwise <code>false</code>
     */
    boolean isPrimary() default false;
    /**
     * Signifies whether or not the column auto increments. <code>false</code> by default.
     * @return <code>true</code> if the column auto increments; otherwise <code>false</code>
     */
    boolean autoIncrement() default false;
    /**
     * The name of the column.
     * @return A <code>String</code> value representing the name of the column.
     */
    String fieldName();    
    /**
     * The state of the method to which the annotation is applied.
     * @return A <code>MethodType</code> representing the Getter/Setter state of the method.
     */
    MethodType methodType();
}
